import java.util.ArrayList;

/**
 * 
 * Food Order class to make objects of each item for each table order
 * store objects in Orders 
 *
 */

public class FoodOrder{

	private String tableName;
	private String item;
	private int quantity;
    private ArrayList<FoodOrder> orderPlaced;

	/**
	 * @param tableName
	 * @param item
	 * @param quantity
	 */
	public FoodOrder(String tableName, String item, int quantity) {
		this.tableName = tableName;
		this.item = item;
		this.quantity = quantity;
		
	}
	public FoodOrder(FoodOrder fo) {
		this.tableName = fo.getTableName();
		this.item = fo.getItem();
		this.quantity = fo.getQuantity();
		
	}

	
	/**
	 * @return the tableName
	 */
	public String getTableName() {
		return tableName;
	}

	/**
	 * @param tableName
	 *            the tableName to set
	 */
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}


	/**
	 * @return the item
	 */
	public String getItem() {
		return item;
	}

	/**
	 * @param item
	 *            the item to set
	 */
	public void setItem(String item) {
		this.item = item;
	}

	/**
	 * @return the quantity
	 */
	public int getQuantity() {
		return quantity;
	}

	/**
	 * @param quantity
	 *            the quantity to set
	 */
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	/**
	 * @return true if same table orders same dish
	 */
	public boolean equals(Object other) {
		if (other instanceof FoodOrder) {
			FoodOrder otherOrder = (FoodOrder) other;
			if ((item.equals(otherOrder.item) && tableName.equals(otherOrder.tableName))) {
				// Integer.toString(tableNo).equals(Integer.toString(otherOrder.tableNo)))
				return true;
			}
		}
		return false;
	}

	/**
	 * 
	 * @return dish items Hashcode
	 */
	public int hashcode() {
		return item.hashCode();
	}



}
